<script type="text/javascript" src="sys/role.js"></script>
<script type="text/javascript" src="sys/roleLimit.js"></script>
<div id="toolbar_gd_role" style="padding: 10px;">
    <form id="searRoleParams">
        <label>ID:</label><input class="easyui-validatebox" type="number" name="id"/>
        <label>角色名称:</label><input class="easyui-validatebox" type="text" name="name"/>
        <label>角色类型:</label>
        <select name="type">
            <option value="">全部</option>
            <option value="1">前台角色</option>
            <option value="2">后台角色</option>
        </select>
    </form>
    <span onclick="searchRole()" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">查询</span>
    <span onclick="addRole()" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">新增</span>
    <span onclick="updateRole()" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改</span>
    <span onclick="removeRole()" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true">删除</span>
</div>
<div class="easyui-layout" fit="true">
    <div data-options="region:'center',split:true" title="角色列表" style="width:60%;position: static;">
        <table class="easyui-datagrid" id="dg_role"
               data-options="fit:true,fitColumns:true,singleSelect:true,pagination:true,pageSize:10,toolbar:'#toolbar_gd_role'">
            <thead>
            <tr>
                <th data-options="field:'id',width:100">ID</th>
                <th data-options="field:'name',width:100">角色名</th>
                <th data-options="field:'type',width:100,formatter:displayRoleType">类型</th>
                <th data-options="field:'state',width:100,formatter:displayState">状态</th>
            </tr>
            </thead>
        </table>
    </div>
    <!-- 右侧角色菜单分配区域 BEGIN -->
    <div data-options="region:'east',split:true" title="授权菜单" style="width:40%;position: static;">
        <ul id="menu_tree_role" class="easyui-tree">
        </ul>
    </div>
    <!-- 右侧角色菜单分配区域 END -->
</div>


<div id="dl_role_edit" class="easyui-dialog" closed="true" title="编辑角色" style="width:400px;height:400px; padding: 10px"
     data-options="resizable:true,modal:true,buttons:'#tb_role_edit',inline:true">
    <form id="form_role_edit" method="post">
        <input type="hidden" name="id"/>
        <div class="mb10">
            <label>角色名称:</label>
            <input class="easyui-validatebox" type="text" name="name" data-options="required:true"/>
        </div>
        <div class="mb10">
            <label>角色类型:</label>
            <select name="type" data-options="required:true">
                <option value="1">前台角色</option>
                <option value="2">后台角色</option>
            </select>
        </div>
        <div class="mb10">
            <label>状态:</label>
            <select name="state" data-options="required:true">
                <option value="1">启用</option>
                <option value="0">禁用</option>
            </select>
        </div>
    </form>
</div>
<div id="tb_role_edit">
    <span onclick="submitRole()" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true">提交</span>
    <span onclick="closeRoleEdit()" class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:true">取消</span>
</div>

